/**
 * 地图操作相关功能 Composable
 * 包含 Cesium 地图的初始化、相机控制、实体管理等
 */
import { useMapCore } from './useMapCore'

export function useMapOperations() {
  // 获取地图核心功能
  const {
    GodViewer,
    UavViewer,
    tracker,
    MapProvider2D,
    MapProvider3D,
    uav_height,
    target_height,
    frustumVisible,
    showFrustum,
    drawWayLine,
    hightLight,
    initMap,
    handleMapMode,
    initPointMode,
    initAreaMode,
    init3DAreaMode,
    locate,
    SetTarget,
    SwitchDisplay,
    clear,
    processPointRecord,
    processAreaRecord,
    process3DAreaRecord,
    showArea,
    draw3DPlane,
    areaRecord,
    pointRecord
  } = useMapCore()

  // 其他数据（这些可能需要根据实际使用情况调整）
  // 注意：areaRecord 和 pointRecord 现在从 useMapCore 获取，不再创建新的

  // 返回所有需要在组件中使用的数据和方法
  return {
    // 响应式数据
    MapProvider2D,
    MapProvider3D,
    GodViewer,
    UavViewer,
    uav_height,
    target_height,
    frustumVisible,
    showFrustum,
    drawWayLine,
    tracker,
    hightLight,
    pointRecord, // 从 useMapCore 获取
    areaRecord,  // 从 useMapCore 获取
    
    // 方法
    initMap,
    handleMapMode,
    initPointMode,
    initAreaMode,
    init3DAreaMode,
    locate,
    SetTarget,
    SwitchDisplay,
    clear,
    processPointRecord,
    processAreaRecord,
    process3DAreaRecord,
    showArea,
    draw3DPlane
  }
}